package com.citywy.service.impl;

import com.citywy.service.AccountService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * 业务层实现类
 */
public class AccountServiceImpl implements AccountService {
    private int i=1;
    public AccountServiceImpl() {
        System.out.println("实例化了AccountServiceImpl");
    }

    public void saveAccount() {
        //scope="prototype"时两次输出都是1，如果为Singleton时输出1,2
        System.out.println(i);
        i++;
        System.out.println("保存账户");
    }

    public void init(){
        System.out.println("对象初始化");
    }

    public void destroy(){
        System.out.println("对象销毁");
    }
}
